package xin.nick.demo;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

/**
 * @Auther: Nick inickning@outlook.com
 * @Date: 2021/3/9 22:47
 * @Description:
 */
@Configuration
public class RmiClient {

    @Bean(name = "userService")
    public RmiProxyFactoryBean getUserService() {
        RmiProxyFactoryBean bean = new RmiProxyFactoryBean();
        bean.setServiceUrl("rmi://127.0.0.1:2002/userService");
        bean.setServiceInterface(IUserService.class);
        return bean;
    }

}
